/*
 * @Author: MuQuanyu(MQy)
 * @Date: 2025-08-30 13:12:28
 * @LastEditTime: 2025-09-12 16:13:47
 * @email: muquanyu@outlook.com
 */
import { http, HttpResponse } from "msw";

const API = import.meta.env.VITE_API_BASE_URL;

export const handlers = [
  http.get(`${API}/api/base/user/person-info`, () => {
    return HttpResponse.json({
      code: 200,
      msg: "ok",
      data: {
        username: "admin",
        nickname: "超级管理",
        headPic: "/public/img/user/male_default.png",
        gender: "M",
        bindInfoList: [],
      },
    });
  }),
  http.get(`${API}/api/base/sys-route/tree`, () => {
    return HttpResponse.json({
      code: 200,
      msg: "ok",
      data: [
        {
          id: "1934888627116376065",
          createTime: "2025-06-17 16:19:32",
          modifyTime: "2025-06-24 14:19:54",
          creatorId: null,
          modifierId: null,
          isDeleted: false,
          path: "/dashboard",
          name: "Dashboard",
          component: null,
          parentId: null,
          sort: "0",
          permission: "",
          type: 0,
          title: "Dashboard",
          iconType: "iconfont",
          icon: "",
          hidden: false,
          requireAuth: false,
          keepAlive: true,
          external: false,
          externalUrl: "",
          extMeta: null,
          children: [
            {
              id: "1934889395701612545",
              createTime: "2025-06-17 16:22:35",
              modifyTime: "2025-09-04 15:03:48",
              creatorId: null,
              modifierId: null,
              isDeleted: false,
              path: "analysis",
              name: "Analysis",
              component: "@/views/Dashboard/Analysis/index.vue",
              parentId: "1934888627116376065",
              sort: "0",
              permission: "",
              type: 1,
              title: "分析页",
              iconType: "iconfont",
              icon: "",
              hidden: false,
              requireAuth: false,
              keepAlive: true,
              external: false,
              externalUrl: "",
              extMeta: null,
              children: null,
              permissionList: [
                {
                  id: "1934889395827441666",
                  path: null,
                  name: "增加",
                  permission: "analysis:add",
                  parentId: "1934889395701612545",
                },
                {
                  id: "1934889395827441667",
                  path: null,
                  name: "删除",
                  permission: "analysis:delete",
                  parentId: "1934889395701612545",
                },
                {
                  id: "1934889395827441668",
                  path: null,
                  name: "编辑",
                  permission: "analysis:edit",
                  parentId: "1934889395701612545",
                },
                {
                  id: "1934889395827441669",
                  path: null,
                  name: "查看",
                  permission: "analysis:view",
                  parentId: "1934889395701612545",
                },
              ],
            },
            {
              id: "1934889739080892417",
              createTime: "2025-06-17 16:23:57",
              modifyTime: "2025-06-25 13:27:11",
              creatorId: null,
              modifierId: null,
              isDeleted: false,
              path: "workbench",
              name: "Workbench",
              component: "@/views/Dashboard/Workbench/index.vue",
              parentId: "1934888627116376065",
              sort: "0",
              permission: "",
              type: 1,
              title: "工作台",
              iconType: "iconfont",
              icon: "",
              hidden: false,
              requireAuth: false,
              keepAlive: true,
              external: false,
              externalUrl: "",
              extMeta: {
                noCloseLabel: true,
              },
              children: null,
              permissionList: [
                {
                  id: "1934889739148001282",
                  path: null,
                  name: "增加",
                  permission: "workbench:add",
                  parentId: "1934889739080892417",
                },
                {
                  id: "1934889739148001283",
                  path: null,
                  name: "删除",
                  permission: "workbench:delete",
                  parentId: "1934889739080892417",
                },
                {
                  id: "1934889739148001284",
                  path: null,
                  name: "编辑",
                  permission: "workbench:edit",
                  parentId: "1934889739080892417",
                },
                {
                  id: "1934889739148001285",
                  path: null,
                  name: "查看",
                  permission: "workbench:view",
                  parentId: "1934889739080892417",
                },
              ],
            },
          ],
          permissionList: null,
        },
        {
          id: "1934890506609164290",
          createTime: "2025-06-17 16:27:00",
          modifyTime: "2025-06-24 14:19:54",
          creatorId: null,
          modifierId: null,
          isDeleted: false,
          path: "/system",
          name: "System",
          component: null,
          parentId: null,
          sort: "0",
          permission: "",
          type: 0,
          title: "System",
          iconType: "iconfont",
          icon: "",
          hidden: false,
          requireAuth: false,
          keepAlive: true,
          external: false,
          externalUrl: "",
          extMeta: null,
          children: [
            {
              id: "1939558130480418818",
              createTime: "2025-06-30 13:34:28",
              modifyTime: "2025-09-04 16:43:10",
              creatorId: "1933453503447969794",
              modifierId: null,
              isDeleted: false,
              path: "org-manager",
              name: "OrgManager",
              component: "@/views/System/OrgManager/index.vue",
              parentId: "1934890506609164290",
              sort: "1",
              permission: "",
              type: 1,
              title: "组织管理",
              iconType: "iconfont",
              icon: "",
              hidden: false,
              requireAuth: true,
              keepAlive: true,
              external: false,
              externalUrl: "",
              extMeta: {},
              children: null,
              permissionList: [
                {
                  id: "1939558130526556162",
                  path: null,
                  name: "增加",
                  permission: "组织管理:add",
                  parentId: "1939558130480418818",
                },
                {
                  id: "1939558130534944770",
                  path: null,
                  name: "删除",
                  permission: "组织管理:delete",
                  parentId: "1939558130480418818",
                },
                {
                  id: "1939558130534944771",
                  path: null,
                  name: "编辑",
                  permission: "组织管理:edit",
                  parentId: "1939558130480418818",
                },
                {
                  id: "1939558130543333377",
                  path: null,
                  name: "查看",
                  permission: "组织管理:view",
                  parentId: "1939558130480418818",
                },
              ],
            },
            {
              id: "1939558066504699906",
              createTime: "2025-06-30 13:34:13",
              modifyTime: "2025-09-04 16:41:24",
              creatorId: "1933453503447969794",
              modifierId: null,
              isDeleted: false,
              path: "menu-manager",
              name: "MenuManager",
              component: "@/views/System/MenuManager/index.vue",
              parentId: "1934890506609164290",
              sort: "2",
              permission: "",
              type: 1,
              title: "菜单管理",
              iconType: "iconfont",
              icon: "",
              hidden: false,
              requireAuth: true,
              keepAlive: true,
              external: false,
              externalUrl: "",
              extMeta: {},
              children: null,
              permissionList: [
                {
                  id: "1939558066550837250",
                  path: null,
                  name: "增加",
                  permission: "菜单管理:add",
                  parentId: "1939558066504699906",
                },
                {
                  id: "1939558066555031553",
                  path: null,
                  name: "删除",
                  permission: "菜单管理:delete",
                  parentId: "1939558066504699906",
                },
                {
                  id: "1939558066559225858",
                  path: null,
                  name: "编辑",
                  permission: "菜单管理:edit",
                  parentId: "1939558066504699906",
                },
                {
                  id: "1939558066559225859",
                  path: null,
                  name: "查看",
                  permission: "菜单管理:view",
                  parentId: "1939558066504699906",
                },
              ],
            },
            {
              id: "1939557956328722433",
              createTime: "2025-06-30 13:33:47",
              modifyTime: "2025-09-04 16:40:31",
              creatorId: "1933453503447969794",
              modifierId: null,
              isDeleted: false,
              path: "role-manager",
              name: "RoleManager",
              component: "@/views/System/RoleManager/index.vue",
              parentId: "1934890506609164290",
              sort: "3",
              permission: "",
              type: 1,
              title: "角色管理",
              iconType: "iconfont",
              icon: "",
              hidden: false,
              requireAuth: true,
              keepAlive: true,
              external: false,
              externalUrl: "",
              extMeta: {},
              children: null,
              permissionList: [
                {
                  id: "1939557956576186369",
                  path: null,
                  name: "增加",
                  permission: "角色管理:add",
                  parentId: "1939557956328722433",
                },
                {
                  id: "1939557956592963586",
                  path: null,
                  name: "删除",
                  permission: "角色管理:delete",
                  parentId: "1939557956328722433",
                },
                {
                  id: "1939557956601352193",
                  path: null,
                  name: "编辑",
                  permission: "角色管理:edit",
                  parentId: "1939557956328722433",
                },
                {
                  id: "1939557956605546497",
                  path: null,
                  name: "查看",
                  permission: "角色管理:view",
                  parentId: "1939557956328722433",
                },
              ],
            },
            {
              id: "1934892039648247809",
              createTime: "2025-06-17 16:33:05",
              modifyTime: "2025-06-30 13:37:51",
              creatorId: null,
              modifierId: null,
              isDeleted: false,
              path: "user-manager",
              name: "UserManager",
              component: "@/views/System/UserManager/index.vue",
              parentId: "1934890506609164290",
              sort: "4",
              permission: "",
              type: 1,
              title: "用户管理",
              iconType: "iconfont",
              icon: "",
              hidden: false,
              requireAuth: false,
              keepAlive: true,
              external: false,
              externalUrl: "",
              extMeta: null,
              children: null,
              permissionList: [
                {
                  id: "1934892039715356674",
                  path: null,
                  name: "增加",
                  permission: "UserManager:add",
                  parentId: "1934892039648247809",
                },
                {
                  id: "1934892039715356675",
                  path: null,
                  name: "删除",
                  permission: "UserManager:delete",
                  parentId: "1934892039648247809",
                },
                {
                  id: "1934892039715356676",
                  path: null,
                  name: "编辑",
                  permission: "UserManager:edit",
                  parentId: "1934892039648247809",
                },
                {
                  id: "1934892039715356677",
                  path: null,
                  name: "查看",
                  permission: "UserManager:view",
                  parentId: "1934892039648247809",
                },
              ],
            },
          ],
          permissionList: null,
        },
      ],
    });
  }),
  http.post(`${API}/api/base/user/login`, () => {
    return HttpResponse.json({
      code: 200,
      msg: "ok",
      data: {
        accessToken: "mock_access",
        refreshToken: "mock_refresh",
        tokenTimes: { expiration: Date.now() + 60 * 60 * 1000 },
      },
    });
  }),
  http.post(`${API}/sys-base-api/token/refresh`, async () => {
    return HttpResponse.json({
      code: 200,
      msg: "ok",
      data: {
        accessToken: "mock_access",
        refreshToken: "mock_refresh",
        tokenTimes: { expiration: Date.now() + 60 * 60 * 1000 },
      },
    });
  }),
  http.get(`${API}/api/base/sys-auth-code/verify-code/db/graph/fetch`, () => {
    return HttpResponse.json({
      code: 200,
      msg: "ok",
      data: {
        base64:
          "iVBORw0KGgoAAAANSUhEUgAAAHgAAAAoCAYAAAA16j4lAAALBUlEQVR4XuWbe1BU1x3H7TRpO23+SOMrmapVmzRifUSsFVPJOI4kKp0Yq200re3YJjpqfOUhNfWVToySqDWD1WoiojQKKi8NalSUh8qCVUGqJoIvkGUXZIFdl2V32f31nrOcs+ee+9h77y4a42fmOyvn/vYK+/F3zr3nYhfQyJBeftXcCxbMGqQYLfyw+0uyuZd8p+cj/FBk+HOyOB10YUoeWnjhkRD/dEwqP0TpNMksHaI1CTZvvYNjlI/PjeaHvhFkVaxQTCRAkpVE3xPJoLODkeRpZwpw9PBNFawGLxxl7Zl+NIRnp3zEvEseKtrdP5AOIi35iXzp56xLMAsRrUX2gyg4FKxsJNmQaE54JOAlGxbMEkr2t1EwDyua73IeydTdSbIRERHMIidbq+Dxq1/khx5o5Kb0e03EBSNWZwZeWdFpO7NEUeLbJlmJ0X+4hKNE2evd+CFDUMGvDZrLjhsi49x0GiSZiJaDF07ysAgmENFywiMhWdTBSPKcmIVgXv4mNGTnQF3qf6AuZSdY9+6DpoJCcFssbLkqu+1uGiSalY+iBi8dcTx5O024rC2MMhwt3Mjfyg9phoie1eNZmnAQCXZ+9TXU7dwF5uQdimkqLAJ/ezv7NllYwQi+o/UIRzxIghHhSEawgvV28huLPTgIKth5+YpEplLu5B4Cv89HTygHK/idPi/T8KK1wgo2RSXxh3X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